<%@ page language="java" contentType="text/html; charset=UTF-8"
    pageEncoding="UTF-8"%>
<%@ taglib prefix="c" uri="http://java.sun.com/jsp/jstl/core" %>
<%@ taglib uri="http://sargue.net/jsptags/time" prefix="javatime" %>
<!DOCTYPE html>
<html>
<head lang="en">
    <meta charset="UTF-8">
    <title></title>
    <jsp:include page="../common/header.jsp"/>
    <jsp:include page="../../common/layer.jsp"></jsp:include>
     <jsp:include page="../../common/mydate.jsp"></jsp:include>
</head>
<body>
<form action="${pathUrl }/admin/adminUser/index" method="post" id="userForm">
<div class="place">
    <span>位置：</span>
    <ul class="placeul">
        <li><a href="#">系统用户</a></li>
    </ul>
</div>

<div class="session-main">
    <table style="border: 0px;width:100%;">
      <tr>
       <td align="left" width="10%">
          <a onclick="alertFrame(0)" class="btn-add"><span><img src="${pathUrl }/public/images/t01.png"></span>添加</a>
       </td>
       <td align="right" width="90%">
	       <ul class="seachform" style="margin-top: 15px;float: right;">
       		<li><label>用户名：</label><input name="username" value="${name}"  type="text" class="scinput"></li>
	        <li>
		        <input readonly="readonly" placeholder="开始时间" onclick="WdatePicker({el:this,dateFmt:'yyyy-MM-dd HH:mm:ss'})" name="startDate"  type="text" class="scinput">
		        -
		        <input readonly="readonly" placeholder="结束时间" onclick="WdatePicker({el:this,dateFmt:'yyyy-MM-dd HH:mm:ss'})" name="endDate"  type="text" class="scinput">
	        </li>
	        <li><label>&nbsp;</label><input name="" type="submit" class="scbtn"  value="查询"></li>
	    </ul>
       </td>
      </tr>
    </table>
    <div id="loadDiv">
        <table class="tablelist">
            <tr><td>编号</td><td>用户名</td><td>密码</td><td>状态</td><td>创建时间</td><td>登录时间</td><td>描述信息</td><td>操作</td></tr>
            <c:forEach items="${Pager.records}" var="temp">
                <tr>
                    <td>${temp.id}</td>
                    <td>${temp.username}</td>
                    <td>${temp.password}</td>
                    <td>${temp.status==1?"1":"2"}</td>
                    <td><javatime:format value="${temp.createTime}" pattern="yyyy-MM-dd HH:mm:ss" /></td>
                    <td><javatime:format value="${temp.lastLoginTime}" pattern="yyyy-MM-dd HH:mm:ss" /></td>
                    <td>${temp.remark}</td>
                    <td>
                        <a onclick="alertFrame(${temp.id})">编辑</a>
                        <a onclick="deleteOne(${temp.id})">删除</a>
                    </td>
                </tr>
            </c:forEach>

        </table>
    </div>

    <div id="pagerDiv">
        <a href="${url}?current=1&name=${name}">首页</a><a href="${url}?current=${Pager.current==1?1:Pager.current-1}&name=${name}">上一页</a>&nbsp;&nbsp; ${Pager.current}/${pages} &nbsp;&nbsp;<a href="${url}?current=${Pager.current==pages?pages:Pager.current+1}&name=${name}">下一页</a> <a href="${url}?current=${pages}&name=${name}">尾页</a>
    </div>

   
</div>
</form>
<jsp:include page="../../common/laypage.jsp"/>

<script type="text/javascript">
    function deleteOne(id){
        ydlConfrim("你是否删除选择的数据？",function(){
            var url="${pathUrl}/admin/adminUser/delete";
            $.post(url,{id:id},function(result){
                layer.alert('id为'+id+'的数据删除成功', {icon: 1}, function () {
                    window.location.href="${pathUrl}/admin/adminUser/index";
                });
            });
        });
    }

    function alertFrame(id) {
        layer.open({
            type: 2,
            title: '',
            shadeClose: true,
            shade: false,
            maxmin: true, //开启最大化最小化按钮
            area: ['893px', '600px'],
            content: '${pathUrl}/admin/adminUser/toAdd?id='+id
        });
    }
</script>
</body>
</html>